"""
__project__ = 'thc'
__file_name__ = 'run_test'
__author__ = 'thc'
__time__ = '2021/1/5/005 16:23'
__product_name = PyCharm
-*- coding:utf-8 -*-
运行
"""
import unittest
import time
from HTMLTestRunner_cn import HTMLTestRunner


test_dir = './test_case'
discovers = unittest.defaultTestLoader.discover(test_dir, pattern='test*.py')

if __name__ == '__main__':
    report_dir = './test_report'
    now = time.strftime('%Y_%m_%d %H_%M_%S')
    report_name = report_dir + '/' + now + 'result.html'

    with open(report_name, 'wb') as f:
        runner = HTMLTestRunner(stream=f, title='测试报告', description='帝国软件')
        runner.run(discovers)